<template>
  <div>
    <input type="text" v-model="msg" /><button @click="sendMsgBtn">搜索</button>
  </div>
</template>

<script>
/* 思路：
收集数据 将数据传递到发送ajax请求的组件中去
ajax在哪个组件中设计  created mounted
此兄弟组件传值  $emit $on eventBus
*/
import eventBus from "../utils/eventBus";
export default {
  name: "",
  props: [""],
  data() {
    return {
      msg: ""
    };
  },

  components: {},

  computed: {},

  beforeMount() {},

  mounted() {},

  methods: {
    sendMsgBtn() {
      eventBus.$emit("sendMsg", this.msg);
    }
  },

  watch: {}
};
</script>
<style lang="" scoped></style>
